package com.atguigu.executor;

import sun.misc.Contended;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author ：Hachimen
 * @date ：Created in 2021/8/30 17:10
 * @description：自定义线程池
 * @modified By：
 * @version: 0.0.1
 */
@Contended
public class ThreadPool {
    private static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10,
            30,
            60,
            TimeUnit.SECONDS,
            new ArrayBlockingQueue<>(10));
    private ThreadPool(){};

    public static ThreadPoolExecutor getThreadPoolExecutor(){
        return threadPoolExecutor;
    }
}
